<%= content_tag :div,
  id: "#{self.class.to_s.underscore}_#{@resource.record_param}",
  class: "relative bg-white rounded shadow-modal flex flex-col group",
  data: {
    component_name: self.class.to_s.underscore,
    resource_name: @resource.class.to_s,
    record_id: @resource.record_param,
    **item_selector_data_attributes(@resource),
    **(try(:drag_reorder_item_data_attributes) || {}),
  } do %>
  <%= content_tag :div,
    class: class_names("relative w-full pb-3/4 rounded-t overflow-hidden", html(:cover, :classes)),
    style: html(:cover, :style) do %>
    <%= render Avo::RowSelectorComponent.new(floating: true, size: :lg, checked: @grid_item_checked) if @resource.record_selector%>
    <%= render_cover %>
    <%= render_badge %>
  <% end %>
  <div class="grid grid-cols-1 place-content-between p-4 h-full">
    <div class="mb-4 h-full flex flex-col space-between">
      <%= render_title %>
      <%= render_body %>
    </div>
    <div class="place-self-end w-full">
      <%= render(Avo::Index::ResourceControlsComponent.new(resource: @resource, reflection: @reflection, parent_record: @parent_record, parent_resource: @parent_resource, view_type: :grid, actions: @actions)) %>
    </div>
  </div>
<% end %>
